package com.iwinding.ladygg.net.callback;

import com.iwinding.ladygg.net.response.AccessTokenRp;
import com.iwinding.ladygg.okhttputils.callback.Callback;
import com.iwinding.ladygg.utils.GsonUtil;
import com.iwinding.ladygg.utils.LogUtil;

import okhttp3.Response;

/**
 * Created by hezhiyong on 2017/3/24.
 */

public abstract class TokenCallback extends Callback<AccessTokenRp> {

    @Override
    public AccessTokenRp parseNetworkResponse(Response response, int id) throws Exception {
        String jsonStr = response.body().string();
        LogUtil.i("@hzy", "icane----Token:" + jsonStr);
        AccessTokenRp accessTokenRp =
                GsonUtil.getInstance().formJson(jsonStr, AccessTokenRp.class);
        return accessTokenRp;
    }
}
